Skip to content

Wire ppPublicKey + register entities in testnet flow scripts#104

Merged
AquiGorka merged 5 commits into
mainfrom
fix-testnet-entity-registration
May 29, 2026
Merged

Wire ppPublicKey + register entities in testnet flow scripts#104
AquiGorka merged 5 commits into
mainfrom
fix-testnet-entity-registration

Conversation

@AquiGorka
Copy link
Copy Markdown
Contributor

Summary

./testnet/run-all.sh (and the local equivalent ./testnet/run-local.sh) was the last set of harness scripts that still spoke the pre-URL-scoped client shape. Both testnet/main.ts and lifecycle/testnet-verify.ts failed at deno-check and would have crashed at the first deposit:

  • e2eConfig was missing the now-required Config.ppPublicKey field — the resolver couldn't dispatch the bundle to a PP, surfaces as a 500.
  • Alice and Bob were never registered as APPROVED entities via POST /api/v1/entities, so even with the URL fixed the platform's SUBMITTER_NOT_APPROVED gate would have rejected every bundle.

Adds a registerEntity helper to each file and sets ppPublicKey: ppOperator.publicKey() / ppKeypair.publicKey() on e2eConfig. Mirrors the equivalent fixes already in lifecycle/main.ts and lifecycle/ci-test.ts.

Test plan

Local stack (./up.sh + setup), then:

  • ./testnet/run-local.sh 1 — payment flow, 88.7s green
  • ./testnet/run-local.sh 3 — lifecycle, 85.3s green
  • deno fmt --check + deno lint clean in testnet/ and lifecycle/
  • deno check testnet/main.ts + deno check lifecycle/testnet-verify.ts clean

AquiGorka added 5 commits May 28, 2026 17:00
The CI flow's `e2e/setup.sh` was updated to include the URL-scoped PP
key, but the local `./test.sh e2e` runner uses a separate
`test/setup-e2e.ts` writer that produces /config/contracts.env from
the setup container. Without E2E_PP_PUBLIC_KEY in that file, the
test-runner's loadConfig() throws before any bundle is submitted.
lifecycle/ci-test.ts is the test runner invoked by lifecycle's docker
compose (and by provider-platform's lifecycle-reusable CI). Two fields
were missed when lifecycle/main.ts was updated for the URL-scoped
bundles work:

- e2eConfig was missing ppPublicKey, so lib/client/bundle.ts composed
  /providers/undefined/bundles, which the resolver couldn't service.
- Alice and Bob weren't registered as APPROVED entities before
  deposit/send, tripping the SUBMITTER_NOT_APPROVED gate.

Mirrors the equivalent fixes already in lifecycle/main.ts.
provider-platform PR #103 (events dashboard redesign) renamed
councilMembership (singular) → councilMemberships (plural array) on
the dashboard /pp/list response. The governance e2e test was never
updated to match. Now reads [0]?.status for the approved/rejected
checks and .length === 0 for the no-council case.
Pay-platform submits bundles to provider-platform under its
PAY_SERVICE_SK identity. provider-platform now gates bundle admission
on the submitter being an APPROVED entity (SUBMITTER_NOT_APPROVED),
so the pay-service keypair needs an entity record before the instant
payment flow can run. New [1b/5] step calls POST /api/v1/entities
with keys.payService right after funding.
testnet/main.ts and lifecycle/testnet-verify.ts are the suites driven
by ./testnet/run-all.sh (and ./testnet/run-local.sh). Both were on the
pre-URL-scoped client shape, so deno-check failed and a real run would
have died at the first deposit:

- e2eConfig was missing the now-required Config.ppPublicKey field
  (the resolver couldn't dispatch the bundle to a PP).
- Alice and Bob were never registered as APPROVED entities, so even
  with the URL fixed the platform's SUBMITTER_NOT_APPROVED gate would
  have rejected every bundle.

Adds a registerEntity helper to each file and seeds the PP key on
Config. Mirrors the equivalent fixes already in lifecycle/main.ts and
lifecycle/ci-test.ts.

Verified locally against the running stack via:
  ./testnet/run-local.sh 1   # payment flow — 88.7s green
  ./testnet/run-local.sh 3   # lifecycle    — 85.3s green
@AquiGorka AquiGorka merged commit be82c1b into main May 29, 2026
7 checks passed
@AquiGorka AquiGorka deleted the fix-testnet-entity-registration branch May 29, 2026 18:52
AquiGorka added a commit that referenced this pull request May 29, 2026
## Summary

`testnet/run-all.sh` exports
`E2E_TRACE_IDS_PATH=\$REPO_ROOT/e2e/e2e-trace-ids.json` so suite 3
(lifecycle flow) writes the trace IDs to the same path suite 4's
verifier reads from. `run-local.sh` was missing the equivalent export —
suite 3 fell back to the CWD default (`<repo>/e2e-trace-ids.json`),
suite 4 still looked in `e2e/`, and the local Jaeger verifier failed
with:

\`\`\`
NotFound: No such file or directory (os error 2):
  readfile '<repo>/e2e/e2e-trace-ids.json'
\`\`\`

Pre-existing — independent of the dashboard-rework work that landed in
#104. Surfaces only when running suite 4 via `./testnet/run-local.sh`.

## Test plan

- [x] \`./testnet/run-local.sh all\` against local stack — all four
suites green (payment ~73s, OTEL verify, lifecycle ~72s, OTEL verify
lifecycle)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant